import type { AxiosResponse } from 'axios'

import Antdv from 'ant-design-vue'
import axios from 'axios'
import { createApp } from 'vue'
import App from './App.vue'
import './mock'
import router from './router'
import store, { injectKey } from './store'
import './style.css'

axios.defaults.withCredentials = true
// unwrap axios response via interceptor
axios.interceptors.response.use(
  (response: AxiosResponse) => {
    return response.data || response
  },
)

createApp(App).use(Antdv).use(store, injectKey).use(router).mount('#app')
